<%@ Page Language="C#" MasterPageFile="~/MasterPages/manager/manager.master" AutoEventWireup="true" CodeFile="Categories.aspx.cs" Inherits="manager_inventory_Categories" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>Manage Categories</h2>
    <asp:Literal runat="server" ID="litSelectedValue" />
    <%=StartRoundCorner() %>
    <asp:Button id="btnShowCreateCategoryForm" onclick="btnShowCreateCategoryForm_Click" runat="server" Text="Create a New Category"></asp:Button> <asp:Button id="btnEdit" onclick="btnEdit_Click" runat="server" Text="Edit Selected" Enabled="False"></asp:Button>&nbsp;<asp:Button id="btnCustomize" onclick="btnCustomize_Click" runat="server" Text="Customise Selected" Enabled="False"></asp:Button>&nbsp; Other Action: <asp:DropDownList id="ddlAction" runat="server" OnSelectedIndexChanged="ddlAction_SelectedIndexChanged" AutoPostBack="True">
        <asp:ListItem Selected="True">Select...</asp:ListItem>
        <asp:ListItem Value="delete">Delete Selected</asp:ListItem>
        <asp:ListItem Value="up">Move Up</asp:ListItem>
        <asp:ListItem Value="down">Move Down</asp:ListItem>
    </asp:DropDownList> 
    Move Selected: <asp:Button runat="server" ID="btnMoveUp" Text="Up" OnClick="lbMoveUp_Click" />&nbsp;
    <asp:Button runat="server" ID="btnMoveDown" Text="Down" OnClick="lbMoveDown_Click" />
    <%=EndRoundCorner() %>
    
    <asp:Panel id="panelAddEditCategory" runat="server" Visible="False" Width="50%" BorderStyle="None">
        <h3>Category Information</h3>
        <%=StartRoundCorner() %>
        <div style="margin-bottom:10px">
            <asp:Button ID="btnUpdateCategory" runat="server" Text="Save Category" OnClick="btnUpdateCategory_Click" style="font-weight:bold;margin-right:10px" />
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" style="margin-right:10px" />
            <asp:HyperLink runat="server" ID="linkCustomize" Text="Customize..." />
        </div>
        Category Title:
        <asp:TextBox ID="txtCategoryName" runat="server" Columns="50" MaxLength="200"></asp:TextBox><br /><br />
        Child Of (select parent category):<br />
        <asp:TreeView ID="tvCategorySelector" runat="server" OnDataBinding="tvCategorySelector_DataBinding" ShowLines="True" OnAdaptedSelectedNodeChanged="tvCategorySelector_OnSelectedNodeChanged">
            <SelectedNodeStyle Font-Bold="True" />
        </asp:TreeView>
        <asp:HiddenField runat="server" ID="fieldSelectedCategory" />
        <%=EndRoundCorner() %>
    </asp:Panel> 
    
    <div class="AspNet-TreeView">
        <%=new TanashCMS.Business.Task.InventoryTask(mWebsite.ID).GenerateCategoryTree(0, _categoryId, "Categories.aspx?cid={0}", "{1}", "", "", "AspNet-TreeView-Selected" ) %>
    </div>

</asp:Content>

